package com.hs.jhzd.repository;

import java.util.Date;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import com.hs.jhzd.entity.PoliceIntoPrisonRecord;

@Repository
public interface PoliceIntoPrisonRecordRepository
    extends JpaRepository<PoliceIntoPrisonRecord, String> {

  @Query("select u from PoliceIntoPrisonRecord u where (u.sksj between :startTime and :endTime)")
  List<PoliceIntoPrisonRecord> findByTime(@Param("startTime") Date startTime,
      @Param("endTime") Date endTime);

  @Query("select u from PoliceIntoPrisonRecord u where u.mjxm like %:policeName% and (u.sksj between :startTime and :endTime)")
  List<PoliceIntoPrisonRecord> findByPoliceNameAndTime(@Param("policeName") String policeName,
      @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}
